package com.teatang.tadmin.core.exception.handler;

import com.teatang.tadmin.util.ServletUtils;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class AuthExceptionHandler {

    @ExceptionHandler(value = AuthorizationException.class)
    public ModelAndView authPageExceptionHandler(AuthorizationException e) {
        ModelAndView modelAndView = new ModelAndView();
        //指定错误页面的模板页
        modelAndView.setViewName("index/login");
//        modelAndView.addObject("errMsg", e.getMessage());
        return modelAndView;
    }

}
